//
//  BaseView.m
//  LotteryClient
//
//  Created by Suny on 14-7-13.
//  Copyright (c) 2014年 CTTC. All rights reserved.
//

#import "BaseView.h"

@implementation BaseView
- (id)init
{
	self = [super init];
	if (self)
	{
		
	}
	return self;
}
- (void)dealloc
{
    _delegate = nil;

//	DLog(@"==================debug dealloc");
//	DLogObject(self);
//	DLog(@"===============================")
}

- (void)suppressDelegateForAction:(void (^)(void))actionBlock
{
    BOOL oldStatus = self.suppressDelegate;
    self.suppressDelegate = YES;
    if (actionBlock != NULL) {
        actionBlock();
    }
    self.suppressDelegate = oldStatus;
}

- (void)didAddSubview:(UIView *)subview
{
    [super didAddSubview:subview];
    if (!self.suppressDelegate && [self.delegate respondsToSelector:@selector(viewDidAddSubview:)]) {
        [self.delegate viewDidAddSubview:subview];
    }
}

- (void)bringSubviewToFront:(UIView *)view
{
    [super bringSubviewToFront:view];
    if (!self.suppressDelegate && [self.delegate respondsToSelector:@selector(viewDidBringSubviewToFront:)]) {
        [self.delegate viewDidBringSubviewToFront:view];
    }
}



@end
